<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 唯一标识当前定时器
      const s1 = setTimeout(() => {
        console.log("hello1");
      }, 3000);

      const s2 = setTimeout(() => {
        console.log("hello2");
        clearTimeout(s1);
      }, 2000);

      // clearTimeout(s2);
    </script>
  </body>
</html>
